use crate::helpers::Bot;
use anyhow::Result;
use db::{Db, /*models::MatrixOrTelegramId*/};
use teloxide::prelude::*;
use uuid::Uuid;
pub async fn delete(bot: Bot, q: CallbackQuery, data: &str, database: Db) -> Result<()> {
    let user_id = q.from.id;
    // let user = database.get_user_id(&MatrixOrTelegramId::TelegramId { id: user_id, username: None }).await?;
    let post_id = Uuid::parse_str(data)?;
    database.delete_post(post_id).await?;
    bot.answer_callback_query(q.id).text("Deleted!").await?;
    if let Some(message) = q.message {
        bot.delete_message(message.chat.id, message.id).await?;
    }
    Ok(())
}